<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_content
 *
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;
global $uid;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
$id = JRequest::getVar('id');
$aid = JRequest::getVar('aid');
//echo JLayoutHelper::render('joomla.content.categories_service', $this);
//echo $this->loadTemplate('items');
?>
<h2 class="title">Services</h2>
<p>&nbsp;</p>
<div class="left-col">
	<?php 
	echo JLayoutHelper::render('joomla.content.categories_service', $this);
	echo $this->loadTemplate('items');
	?>
</div>
<div class="right-col">
    <div class="article">
        <?php 
        if(!$aid){
			if(isset($this->items[$this->parent->id][0]->id)){
				$aid = $this->items[$this->parent->id][0]->id;
			}else{
				echo 'No data';
			}	
		}
        $sql = "select * from #__content where state = 1 and catid =".$aid;
        $db	=& JFactory::getDBO();
        $db->setQuery($sql);
        $rows = $db->loadObjectList();
        if(count($rows)){
			
        ?>
        <ul class="list-price">
         	<?php foreach($rows as $row){?>
         	     <li><?php echo $row->title;?><span class="price">$<?php echo $row->price;?></span></li>
			<?php }?>
        </ul>
        <?php }else{ echo 'No Data';}?>
    </div>
</div>
